//
//  LBCropPanelView.h
//  LBCropImagePage
//
//  Created by mac on 2024/6/2.
//

#import <UIKit/UIKit.h>
#import "LBMediaRotateScroller.h"
#import "LBCropConfig.h"

@class LBCropPanelView;

NS_ASSUME_NONNULL_BEGIN

@protocol LBCropPanelViewDelegate <NSObject>

/// 转动的回调
/// - Parameters:
///   - cropPanel: 转动的panel
///   - ratate: 当前转动角度，占整体可旋转角度的百分比
- (void)cropPanel:(LBCropPanelView *)cropPanel roate:(CGFloat)ratate;

/// 完成按钮
/// - Parameter panelType: 面板类型
- (void)panelDidCompleteWithPanelType:(NSString *)panelType;

/// 取消按钮
/// - Parameter panelType: 面板类型
- (void)panelDidCancelWithPanelType:(NSString *)panelType;


/// 裁剪指定比例
/// - Parameter ratioType: 比例
- (void)cropWithRatioType:(kCropRatioType)ratioType;

/// 向右旋转90°
- (void)rotateRight;

@end

@interface LBCropPanelView : UIView

@property (nonatomic, weak) id <LBCropPanelViewDelegate> delegate;

@property (nonatomic, assign) CGSize originRario;

@property (nonatomic, assign) CGFloat angle;

- (instancetype)initWithFrame:(CGRect)frame
                        ratio:(kCropRatioType)ratio
                        angle:(CGFloat)angle
                       rotate:(kCropOriginAngle)rotate;

- (void)showPanelWithSuperView:(UIView *)view
                       sibling:(dispatch_block_t)sibling;

- (void)showPanelWihtSuperView:(UIView *)view
                       sibling:(dispatch_block_t)sibling
                    completion:(dispatch_block_t _Nullable)completion;

- (kCropRatioType)cropRatioType;

@end

NS_ASSUME_NONNULL_END
